package com.medical.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.medical.app.common.dto.PatientDto;
import com.medical.app.entity.Patient;
import com.medical.app.mapper.PatientMapper;
import com.medical.app.service.PatientService;
import com.qf.medical.utils.BeanConvertUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Date : 2024/4/30 上午10:51
 * @Created by Lang
 * @ProjectName : medical-appointment-registration
 */
@Service
public class PatientServiceImpl implements PatientService {
    @Resource
    private PatientMapper patientMapper;

    @Override
    public List<PatientDto> listByWei(Integer weichatId) {
        LambdaQueryWrapper<Patient> eq = new LambdaQueryWrapper<Patient>().eq(Patient::getWeichatId, weichatId);
        List<Patient> patients = patientMapper.selectList(eq);
        return BeanConvertUtils.convertListTo(patients, PatientDto::new);
    }
}
